<template>
    <div class="charts" ref="charts">

    </div>
</template>

<script>
import * as echarts from 'echarts';
export default {
    props: ['activityRate'],
    mounted() {
        let lineCharts = echarts.init(this.$refs.charts);
        lineCharts.setOption({
            xAxis: {
                show: false,
                min: 0,
                max: 100
            },
            yAxis: {
                show: false,
                type: 'category'
            },
            series: [
                {
                    type: 'bar',
                    data: [this.activityRate],
                    barWidth: 10,
                    color: 'yellowgreen',
                    showBackground: true,
                    backgroundStyle: {
                        colot: '#eee'
                    },
                    label: {
                        show: true,
                        formatter: '|',
                        position: 'right'
                    }
                }
            ],
            grid: {
                left: 10,
                top: 10,
                right: 10,
                bottom: 10
            }
        })
    }
}
</script>

<style scoped>
.charts {
    width: 100%;
    height: 100%;
}
</style>